<?php /* Smarty version 2.6.16, created on 2009-04-16 03:17:21
         compiled from public/account/livechat/index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'language', 'public/account/livechat/index.html', 7, false),array('function', 'url', 'public/account/livechat/index.html', 29, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "public/_header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	
<body style="margin:0px auto 0px; auto; padding:0px;">
<div id="main-body"></div>
<div id="outer" style="cursor:default; margin:0px auto 0px auto; padding:0px; width:98%;">
<div class="mainmenu5" style="padding:8px;font-size:12pt;letter-spacing:2px;">
	<b><?php echo smarty_function_language(array('text' => 'Mod_Chat.live_chat'), $this);?>
</b>
</div>

<?php if ($this->_tpl_vars['bMembersLimit']): ?>

	<table class="border2" style="width:100%;" cellpadding="4" cellspacing="0">
	<tr>
		<td style="font-size:9pt;" class="color">
		<br/><br/><br/>
		<?php echo smarty_function_language(array('text' => 'Mod_Chat.ChatFullTryLater'), $this);?>

		<br/><br/><br/>
		</td>
	</tr>
	</table>
</div>

<?php else: ?>

<table class="border2" style="width:100%;" cellpadding="4" cellspacing="0">
<tr>
	<td style="font-size:9pt;" class="color">

	<form method="post" action="<?php echo smarty_function_url(array('link' => 'public.account.livechat'), $this);?>
">
	<b><?php echo smarty_function_language(array('text' => 'Mod_Chat.rooms'), $this);?>
:</b>
	<select name="roomid" style="width:200px;" onchange="submit();">
	<option value="1"><?php echo smarty_function_language(array('text' => 'Mod_Chat.select'), $this);?>
</option>
	<?php $_from = $this->_tpl_vars['aRooms']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['aRoom']):
?>
		<option value="<?php echo $this->_tpl_vars['aRoom']['roomid']; ?>
"<?php if ($this->_tpl_vars['iRoomId'] == $this->_tpl_vars['aRoom']['roomid']): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['aRoom']['name']; ?>
</option>
	<?php endforeach; endif; unset($_from); ?>
	</select>
	</form>

	<table style="width:100%; height:300px;" cellpadding="0" cellspacing="4" border="0">
	<tr>
	<td style="width:75%; vertical-align:top;" class="border2">
		<div id="chat_content_div" style="overflow:auto; height:298px;">
			<div id="fullchat"><?php echo $this->_tpl_vars['sChatContent']; ?>
</div>
		</div>
	</td>
	<td style="width:25%; vertical-align:top;" class="border2">
		<div class="mainmenu5" style="padding:8px;">
			<img src="<?php echo $this->_tpl_vars['sStylePath']; ?>
spacer.gif" class="sqr" style="vertical-align:middle;" alt="" width="7" height="7" />
			<span style="vertical-align:middle;"><b><?php echo smarty_function_language(array('text' => 'whos_chatting'), $this);?>
</b></span>
		</div>
		<div id="onlineuser" style="overflow:auto; height:298px;"><?php echo $this->_tpl_vars['sWhosOnline']; ?>
</div>
	</td>
	</tr>
	</table>

    <form style="padding:0px; margin:0px;" id="signupForm" action="javascript:void(null);" onsubmit="submitSignup();">
    <input id="user" name="user" value="<?php echo $this->_tpl_vars['aCurrUser']['user']; ?>
" type="hidden" />
    <input id="typeF" name="typeF" value="full" type="hidden" />
	<table style="width:100%;">
	<tr>
		<td colspan="2">
		<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ($this->_tpl_vars['sSmartyTemplateDir'])."/_blocks/smilies.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
		</td>
	</tr>
	<tr>
		<td>
		<textarea cols="60" rows="9" style="width:98%;" id="maintext" name="sTxt" onkeyup="return (!entsub(event)) ? false : entsub(event);"></textarea>
		</td>
		<td>
		<input type="button" value="<?php echo smarty_function_language(array('text' => 'Mod_Chat.send'), $this);?>
" style="cursor:pointer;" id="submitButton" onclick="submitAjaxForm()" />
		</td>
	</tr>
	</table>
	</form>

	</td>
</tr>
</table>
</div>
<script type="text/javascript">window.setInterval("xajax_getOnlineUser('<?php echo $this->_tpl_vars['iRoomId']; ?>
')", 7000);</script>
<script type="text/javascript">window.setInterval("xajax_getChatText('1', '<?php echo $this->_tpl_vars['iRoomId']; ?>
')", 5000);</script>
<script type="text/javascript">
<?php echo '

document.getElementById(\'chat_content_div\').scrollTop = document.getElementById(\'chat_content_div\').scrollHeight;

function submitAjaxForm()
{
	tinyMCE.triggerSave(false, false);
	tinyMCE.execCommand(\'mceSetContent\',false, \'\');
	'; ?>

	xajax_processForm(xajax.getFormValues("signupForm"), <?php echo $this->_tpl_vars['iRoomId']; ?>
);
	<?php echo '
	return false;
}

function entsub(event)
{
	var Key = event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode);

	if (Key == 13)
	{
		submitAjaxForm();
		return false;
	}
	else
	{
        return true;
	}
}

'; ?>

</script>
<?php endif; ?>
</body>
</html>